//
//  ZCXPetAmuseCollectionViewCell.m
//  LoveOfPet
//
//  Created by dllo on 15/11/15.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "ZCXPetAmuseCollectionViewCell.h"
#define HEIGHT  [[UIScreen mainScreen]bounds].size.height / 667
#define WIDTH   [[UIScreen mainScreen]bounds].size.width / 375
@interface ZCXPetAmuseCollectionViewCell ()
@property (nonatomic, retain) UIView *backView;
@end

@implementation ZCXPetAmuseCollectionViewCell
- (void)dealloc{
    [_imageView release];
    [_label release];
    [_backView release];
    [super dealloc];
}
- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backView = [[UIView alloc] init];
        _backView.layer.shadowOffset = CGSizeMake(-1 * WIDTH, -1 * HEIGHT);
        _backView.layer.shadowColor = [UIColor grayColor].CGColor;
        _backView.layer.shadowOpacity = 1 * WIDTH;
        [self.contentView addSubview:_backView];
        [_backView release];
        
        self.imageView = [[UIImageView alloc]init];
        [self.backView addSubview:_imageView];
        [_imageView release];
        self.label = [[UILabel alloc]init];
        [self.imageView addSubview:_label];
        [_label release];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.backView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    _imageView.frame = CGRectMake(1 * WIDTH, 1 * HEIGHT, self.frame.size.width - 2 * WIDTH, self.frame.size.height - 2 * HEIGHT);
    _label.textAlignment = NSTextAlignmentRight;
    _label.textColor = [UIColor whiteColor];
    _label.font = [UIFont systemFontOfSize:13 * WIDTH];
    _label.layer.shadowColor = [UIColor grayColor].CGColor;
    _label.frame = CGRectMake(self.imageView.frame.size.width - 100 * WIDTH, self.imageView.frame.size.height - 30 * HEIGHT, 90 * WIDTH, 30 * HEIGHT);
}
@end
